//新增
function toUplaodTemplateView() {
    mini.open({
        url: "/azbj/sjtjfx/scbg/uploadtemplate/view",
        title: "上传",
        width: "25%",
        height: "50%",
        allowDrag: true,
        allowResize: false,
        showCloseButton: true,
        onload: function () {
        },
        ondestroy: function (action) {
            grid.reload();
        }
    });
}

//修改
function toEditTemplateView() {
    var row = grid.getSelected();
    mini.open({
        url: "/azbj/sjtjfx/scbg/uploadtemplate/view?id=" + row.id,
        title: "上传",
        width: "25%",
        height: "50%",
        allowDrag: true,
        allowResize: false,
        showCloseButton: true,
        onload: function () {
        },
        ondestroy: function (action) {
            grid.reload();
        }
    });
}

//删除
function delTemplate() {
    var row = grid.getSelected();
    if (row) {
        var str = "确认删除该条记录吗？";
        if (confirm(str)) {
            $.ajax({
                url: "/azbj/sjtjfx/scbg/uploadtemplate/delTemplate?id=" + row.id,
                type: "post",
                cache: false,
                success: function (result) {
                    mini.alert(result.data);
                    grid.reload();
                }
            });
        }
    } else {
        mini.alert("请至少选中一条记录");
    }
}